﻿using System.Collections.Generic;
using UnityEngine;


namespace Code.UI
{
    public class CardSystem:MonoBehaviour
    {
        public List<Card> CardItem = new List<Card>();

        private List<Card> _tempCardList = new List<Card>();

        public List<Card> GetCard(int num) 
        {
            _tempCardList.Clear();
            int count = 0;
            if (num >= CardItem.Count) 
            {
                count = CardItem.Count;
            }
            else 
            {
                count = num;
            }
            for (int i = 0; i < count; i++)
            {
                Card card =CardItem[Random.Range(0,CardItem.Count-1)];
                _tempCardList.Add(card);
            }
            return _tempCardList;
        }
    }
}
